package com.sff.events {
	import com.sff.site.events.FlowEvent;
	import com.sff.module.Module;
	
	import flash.events.Event;	

	public class ModuleEvent extends FlowEvent {

		public static const ADDED 			: String = "moduleAdded";
		public static const REMOVED 		: String = "moduleRemoved";
		public static const LOADED 			: String = "moduleLoaded";
		public static const CHILD_RESIZE	: String = "childResize";
		public static const DRAWING			: String = "moduledrawing";
		public static const DRAWN 			: String = "moduledrawn";		
		public static const FRAME_VISIBLE 	: String = "moduleFrameVisible";
		public static const FRAME_ALPHA 	: String = "moduleFrameAlpha";
		
		private var _target 				: Module;
		private var _bubbles 				: Boolean;
		
		override public function get target() : Object  {
			return _target;
		}

		public function get module() : Module  {
			return _target;
		}
		
		public function get mbubble() : Boolean {
			return _bubbles;
		}

		public function ModuleEvent(type : String, target : Module, bubbles : Boolean = false, cancelable : Boolean = false  ) {
			super( type , false , cancelable );
			_target = target;
			_bubbles = bubbles;
		}

		override public function clone() : Event {
			return new ModuleEvent(type, _target , _bubbles, cancelable );
		}
	}
}
